//
//  ProduceNoDataView.m
//  ZJControlsClass
//
//  Created by mac on 2024/11/29.
//

#import "ProduceNoDataView.h"


@interface ProduceNoDataView ()

@property (nonatomic,strong) UIView * follewView;
@property (nonatomic,strong) UILabel * titleLabel;
@property (nonatomic,strong) UIImageView * img;
@property (nonatomic,strong) UILabel * msgLabel;


@end



@implementation ProduceNoDataView


- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self){
        
        self.backgroundColor = COLOR_RGB(50, 113, 237);
        
        [self configUI];
        
        
        
        
    }
    return self;
}

-(void)configUI{
    
    [self addSubview:self.follewView];
    [self.follewView addSubview:self.titleLabel];
    [self.follewView addSubview:self.img];
    [self.follewView addSubview:self.msgLabel];
    
    [self.follewView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(self).with.offset(ALIGN_HEIGHT_PT(30));
        make.left.equalTo(self).with.offset(ALIGN_WIDTH_PT(27.5));
        make.right.equalTo(self).with.offset(-ALIGN_WIDTH_PT(27.5));
        make.height.equalTo(@(ALIGN_HEIGHT_PT(490)));
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.follewView.mas_centerX);
        make.top.equalTo(self.follewView).with.offset(ALIGN_HEIGHT_PT(76));
    }];
    
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.titleLabel.mas_centerX);
        make.top.equalTo(self.titleLabel.mas_bottom).with.offset(ALIGN_HEIGHT_PT(16));
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(150), ALIGN_WIDTH_PT(150))));
    }];
    
    [self.msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.titleLabel.mas_centerX);
        make.top.equalTo(self.img.mas_bottom).with.offset(ALIGN_HEIGHT_PT(12));
    }];
    
    
    
    
    
}

#pragma mark -- 懒加载

-(UIView *)follewView{
    if (!_follewView){
        _follewView = [UIView new];
        _follewView.layer.cornerRadius = 8;
        _follewView.layer.masksToBounds = YES;
        _follewView.backgroundColor = [UIColor whiteColor];
    }
    return _follewView;
}

-(UILabel *)titleLabel{
    if (!_titleLabel){
        _titleLabel = [UILabel new];
        _titleLabel.text = @"暂无通行证";
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.font = [UIFont systemFontOfSize:18 weight:0.5];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLabel;
}


-(UIImageView *)img{
    if (!_img){
        _img = [UIImageView new];
        _img.image = [UIImage imageNamed:@"空数据"];
    }
    return _img;
}

-(UILabel *)msgLabel{
    if (!_msgLabel){
        _msgLabel = [UILabel new];
        _msgLabel.text = @"该用户暂无通行证";
        _msgLabel.textColor = COLOR_RGB(102, 102, 102);
        _msgLabel.font = FONT14;
        _msgLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _msgLabel;
}







@end
